package com.dap.cas.util;

import javax.servlet.http.HttpServletRequest;
import java.security.Principal;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2017/12/13
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2017/12/13
 */
public class CASUtil {
    /**
     * 从cas中获取用户名
     *
     * @param request
     * @return
     */
    public static String getAccountNameFromCas(HttpServletRequest request) {
        Principal userPrincipal = request.getUserPrincipal();
        return userPrincipal.getName();
    }
}
